unit AVProtectedAccess;

interface
uses SysUtils, Classes, Controls;

type

  TPAWinControl = class(TWinControl)
  public
    procedure SetChildOrder(Child: TComponent; Order: Integer);
    function GetChildOrder(Child: TComponent): integer;
  end;

implementation

//TPAWinControl

    procedure TPAWinControl.SetChildOrder(Child: TComponent; Order: Integer);
    begin
      inherited SetChildOrder(Child, Order);
    end;

    function TPAWinControl.GetChildOrder(Child: TComponent): integer;
    var i: integer;
    begin
      Result := -1;
      for i := 0 to Self.ControlCount - 1 do
        if Self.Controls[i] = Child then begin
          Result := i;
          break;
        end;
    end;

end.
